import { http } from '@/utils/request'
import type { Facility, ApiResponse } from '@/types'

// 获取设施列表
export const getFacilityList = (params?: {
  floor?: string;
  type?: string;
  search?: string;
}): Promise<ApiResponse<Facility[]>> => {
  return http.get('/client/facilities', { params })
}

// 搜索设施
export const searchFacilities = (params: {
  q: string;
  floor?: string;
}): Promise<ApiResponse<Facility[]>> => {
  return http.get('/client/facilities/search', { params })
}

// 获取设施详情
export const getFacilityDetail = (id: number): Promise<ApiResponse<Facility>> => {
  return http.get(`/client/facilities/${id}`)
} 